$(function() {
    $.ajax({
        type: "get",
        url: "http://chst.vip:1234/api/getinlanddiscount"
    }).then((res) => {
        var arr = res.result;
        let html = ''
        arr.forEach(item =>{
          html += `
          <li productid=${item.productId}>
            <div class="lis" >
            <div class="imge">${item.productImg}</div>
            <div class="title">${item.productName}</div>
            <p class="price">${item.productPrice}</p>
            <p class="from">${item.productFrom} | ${item.productTime}</p>
            </div>
        </li>
          
          `
        })
        $('.select').html(html)



        $("ul").on("click", "li", function () {
                let productid = $(this).attr("productid")
                location.href = `./detail2.html?productid=${productid}`
            })
        
    })
      })